package model.banco;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class ConexaoFactory {
	
	private static ConexaoFactory instance;
	
	public static Connection getConnection() {
		try {
			return DriverManager.getConnection(
					"jdbc:postgresql://localhost:5432/postgres/public", "postgres",
					"root");
		} catch (SQLException e) {
			e.printStackTrace();
			throw new RuntimeException(e);
		}
	}


	private ConexaoFactory(){
		
	}

	public static ConexaoFactory getInstance() {
		if(instance == null){
			instance = new ConexaoFactory();
		}
		return instance;
	}
	
}